import { BrowserRouter, Route, Routes } from 'react-router-dom';

import AuthPage from './assets/components/pages/AuthPage';
import CreateEmployeePage from './assets/components/pages/CreateEmployeePage';
import EmployeeListPage from './assets/components/pages/EmployeeListPage';
import EmployeePage from './assets/components/pages/EmployeePage';
import MainPage from './assets/components/pages/MainPage';
import './globals.scss';

function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route
          path={'/'}
          element={<MainPage />}
        />
        <Route
          path={'/auth'}
          element={<AuthPage />}
        />

        <Route path={'/admin'}>
          <Route path={'view'}>
            <Route
              index
              element={<EmployeeListPage />}
            />

            <Route
              path={':id'}
              element={<EmployeePage />}
            />
          </Route>

          <Route
            path={'new'}
            element={<CreateEmployeePage />}
          />
        </Route>
      </Routes>
    </BrowserRouter>
  );
}

export default App;
